package com.david.elasticjob.job;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;

/**
 * @author David
 * @version V1.0
 * @Package com.david.elasticjob.job
 * @date 2021/5/4 11:00
 */
public class HelloJob implements SimpleJob {
    @Override
    public void execute(ShardingContext shardingContext) {
        System.out.println("=========================hello job start =========================");
        System.out.println("hello:作业名称："+shardingContext.getJobName());//作业
        System.out.println("hello:作业任务ID："+shardingContext.getTaskId());
        System.out.println("hello:分片总数："+shardingContext.getShardingTotalCount());
        System.out.println("hello:作业自定义参数："+shardingContext.getJobParameter());
        System.out.println("hello:分片项："+shardingContext.getShardingItem());
        System.out.println("hello:作业分片参数："+shardingContext.getShardingParameter());
        System.out.println("=========================hello job end! =========================");
    }
}
